<template>
	<page-navbar title="Search" :autoBack="false" :isLeft="false"></page-navbar>
	<view class="container">
		<view class="header">
			<view class="search">
				<up-search
					shape="square"
					bgColor="#19191F"
					borderColor="#BABABA"
					height="74rpx"
					:searchIconSize="28"
					placeholder="Search headphone"
					:showAction="false"
					color="#fff"
				></up-search>
			</view>
		</view>
		<view class="seach_history">
			<view class="search_title">Lastest search</view>

			<view class="history_list">
				<view class="history_item" v-for="(item, index) in 2" :key="index">
					<image class="time_img" src="@/static/images/search/time_icon.png" mode=""></image>
					<view class="history_text">TMA2 Wireless</view>
				</view>
			</view>
		</view>
		<view class="def_content">
			<view class="def_title">Popular product</view>
			<view class="def_list">
				<view class="def_item" v-for="(item, index) in 4" :key="index" @click="clickGame(item)">
					<view class="p_img">
						<img class="product_img" src="@/static/images/search/product_img.png" alt="" />
					</view>
					<view class="def_right">
						<view class="product_name">TMA-2 Comfort Wireless</view>
						<view class="product_money">USD 270</view>
						<view class="score">
							<image class="star_img" src="@/static/images/search/star.png" mode=""></image>
							<view class="score_text">4.6 &nbsp; 86 Reviews</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	
	<tabbar :current='2'></tabbar>
</template>

<script setup>
import { ref, reactive, onMounted, watch } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';

onLoad(() => {
	uni.hideTabBar({
		animation: false
	});
});

onMounted(() => {});

const clickGame=(item)=>{
	uni.navigateTo({
		url:'/pages/search/game'
	})
}

</script>

<style lang="scss" scoped>
.container {
	background-color: #19191f;
	width: 100vw;
	padding: 0 32rpx;
	box-sizing: border-box;
	overflow: hidden;
	font-size: 32rpx;
	line-height: 40rpx;
	.header {
		margin-top: 66rpx;
	}
	.seach_history {
		margin-top: 60rpx;
		.history_list {
			margin-top: 40rpx;
			.history_item {
				display: flex;
				align-items: center;
				margin-bottom: 50rpx;
				.time_img {
					width: 40rpx;
					height: 40rpx;
					display: block;
					margin-right: 20rpx;
				}
				.history_text {
					font-size: 26rpx;
					line-height: 40rpx;
				}
			}
		}
	}
	.def_content {
		margin-top: 5rpx;
		.def_title {
			margin-bottom: 20rpx;
		}
		.def_list {
			.def_item {
				display: flex;
				align-items: center;
				margin-bottom: 40rpx;
				.p_img {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 150rpx;
					height: 150rpx;
					margin-right: 30rpx;
					.product_img {
						width: 110rpx;
						height: 110rpx;
						display: block;
					}
				}
				.def_right {
					height: 150rpx;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					font-size: 32rpx;
					line-height: 44rpx;
					.product_money {
						font-size: 28rpx;
						line-height: 40rpx;
					}
					.score {
						display: flex;
						align-items: center;
						.star_img {
							width: 32rpx;
							height: 32rpx;
							display: flex;
							margin-right: 6rpx;
						}
						.score_text {
							font-size: 24rpx;
							line-height: 34rpx;
						}
					}
				}
			}
		}
	}
}
</style>
